import request from '@/utils/request';

export function stockData(query) {//库存信息
  return request({
    url: '/goods/query',
    method: 'get',
    params: query
  });
};

export function addStock(item,query) {//添加库存||编辑库存
  var url = (item==0)?'/goods/add':'/goods/edit';
  return request({
    url: url,
    method: 'post',
    data: query
  });
};

export function delStock(query) {//删除库存
  return request({
    url: 'goods/delete',
    method: 'get',
    params: query
  });
};

// export function examine(query) {//出入库管理
//   return request({
//     url: '/task/queryNeedDo',
//     method: 'get',
//     params: query
//   });
// };

// export function doStock(urls) {//出库
//   return request({
//     url: '/apply/do/' + urls,
//     method: 'get'
//   });
// };

// export function joinStock(urls) {//入库
//   return request({
//     url: '/task/doPurchase/'+urls,
//     method: 'get'
//   });
// };

export function recordStock(urls){//出入库历史记录
  return request({
    url: '/goods/queryNotes/sku/'+urls,
    method: 'get'
  })
}

export function InOutStock(urls){//出/入库管理
	return request({
		url: '/task/queryLog',
		method: 'get',
		params: urls
	})
}
